﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

  xmlns:d="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
  xmlns:cm="clr-namespace:System.ComponentModel;assembly=WindowsBase"

  xmlns:controls="clr-namespace:MiniUML.View.Controls;assembly=MiniUML.View"
  xmlns:shapes="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Controls.View.Shapes"
  xmlns:designItem="clr-namespace:MiniUML.View.Views.ResizeAdorner;assembly=MiniUML.View"

  xmlns:connect="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Controls.View.Connect"

  xmlns:conv="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Converter"
  xmlns:viewconv="clr-namespace:MiniUML.View.Converter;assembly=MiniUML.View"
  >
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/MiniUML.Plugins.UmlClassDiagram;component/Themes/Brushes.xaml"  />

    <ResourceDictionary Source="/MiniUML.Plugins.UmlClassDiagram;component/Themes/UmlTextBox.xaml"  />
  </ResourceDictionary.MergedDictionaries>

  <Style TargetType="{x:Type shapes:UmlUseCaseShape}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Height" Value="{Binding Height}" />
    <Setter Property="Width" Value="{Binding Width}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type shapes:UmlUseCaseShape}">

          <designItem:DesignerItem IsSelected="{Binding Path=IsSelected}"
                                   ResizeSelectedShapes="{Binding ResizeSelectedShapesCommand}"
                                   Background="{x:Null}" ><!-- Background=null makes inner part hittest invisible -->
            <designItem:DesignerItem.Content>

              <Grid>
                <Ellipse HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Height="{Binding Height}"
                         Width="{Binding Width}"
                         Stretch="Fill"
                         Stroke="Black"
                         StrokeThickness="1"
                         StrokeDashArray="{Binding StrokeDashArray}"
                         Fill="White" />

                <TextBox BorderThickness="0" Grid.Row="1"
                          FontFamily="Consola"
                          Margin="0"
                          Background="Transparent"
                          Foreground="Black"
                          IsTabStop="False"
                          Style="{StaticResource UmlTextBox}"
                          Text="{Binding Path=Name}"
                          AcceptsReturn="True"
                          HorizontalAlignment="Center" VerticalAlignment="Center"
                        />
            </Grid>

            </designItem:DesignerItem.Content>
          </designItem:DesignerItem>

          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Cursor" Value="Hand"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
